<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // let a = 'helloworld';
        // console.log(a.charAt(1));
        
       function text(){
        var n = 4399;
        function add(){
            n++;
            console.log(n);
        }
        return{n:n,add:add}
       }


       var result = text();
       var result2 = text();

       result.add();
       result2.add();
       console.log(result.n);
       result2.add();


    </script>
</body>
</html>